  <div class="padding040"><h2 class="profil_h2">Новые партнерки</h2></div>
<div id="lastPartnersList" >  
        <div class="new_partner_wrap pull-left">  

<?php $b=1; 
$tmp_count = count($partners);
?>
<?php foreach ($partners as $item) : ?>
    <div class="partner_home_block  pull-left  <?php if(($b < 4) || ($tmp_count>6 && $b<7)  ){ ?>partner_block_b_b<?php } if($b==1 || $b==2 || $b==4 || $b==5){ ?> partner_block_b_r  <?php } ?>">
                        <div class="home_block_wrap">
                        <div class="partner_home_cat_name"><?php echo $item->cat->name; ?></div>
                        <?php $partnerParams = array('catId'=>$item['catId'], 'partnerUrl'=>$item['url']); ?>
                        <h2><a href="<?php echo Yii::app()->createUrl('partner/profile/index', $partnerParams);?> "><?php echo $item['name']; ?></a></h2>
                        <?php if(!empty($item['subCats'])) : ?>    
                            <ul class="inline unstyled home_subcats">
                                <?php for($i=0; $i<count($item['subCats']); $i++) : ?>
                                    <li class="subcats<?php echo($i); ?>">
                                        <a href="<?php echo Yii::app()->createUrl('partner/default/cat', array('catId'=>$item['subCats'][$i]['catId'], 'parentId'=>$item['subCats'][$i]['parentId']));?> "> <?php echo $item['subCats'][$i]['name']; ?></a>
                                    </li>&nbsp;&nbsp;
                                <?php endfor; ?>    
                            </ul>
                        <?php endif; ?>
                        <div class="partner_block_about">
                            <?php echo CPartnerkiHelper::getShortText($item['about'], 150); ?>
                        </div> 
                        </div>
                        
                        <?php if($item['type'] =='Простая регистрация') : ?>
                            <a  class="btn btn-partn"  href="<?php echo Yii::app()->createUrl('site/refLink', array('name'=>$item['name'])); ?>" target="blank">Зарегистрироваться</a>
                        <?php else : ?>
                            <a  class="btn btn-partn"  href="<?php echo Yii::app()->createUrl('partner/profile/invite', $partnerParams); ?>">Получить инвайт</a>
                        <?php endif; ?>  
                   </div> 


             <?php 
             $b++;
             endforeach; ?>
</div>
</div>      
      